/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.IOException;

/**
 * <p>Project: jse2204 - FileUtilDemo
 * <p>Powered by webrx On 2022-09-27 17:39:04
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class FileUtilDemo {
    public static void main(String[] args) throws IOException {
        //删除目录
        FileUtils.deleteDirectory(new File("c:/abc"));

        //复制目录
        //FileUtils.copyDirectory("d:/abc","c:/abcd");
        copyDir("d:/abc","c:/abcd");

        System.out.println(FileUtils.getUserDirectoryPath()); //系统账号的家目录


    }

    public static void copyDir(String src,String dst){
        try{
            FileUtils.copyDirectory(new File(src),new File(dst));

        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
